import React, {Component} from 'react';
import {
    Image,
    StyleSheet
}      from "react-native";
import PropTypes               from 'prop-types';
import ScreenUtils             from '../utils/ScreenUtils'

export default class TabBarItem extends Component {


    constructor(props) {
        super(props);
    }

    static defaultProps = {
        tintColor: '#ffffff',
        focused: false,
        normalImage: NaN,
        selectedImage: NaN,
    };

    static propTypes = {
        tintColor:PropTypes.string,
        focused: PropTypes.bool,
        normalImage: PropTypes.number,
        selectedImage: PropTypes.number,
    };

    render() {
        return (
            <Image source={this.props.focused ? this.props.selectedImage : this.props.normalImage }
                   style={[styles.imageStyle,{tintColor:this.props.tintColor}]}
            />
        );
    }
}

const styles = StyleSheet.create({
    imageStyle:{
        width:ScreenUtils.scaleSize(54),
        height:ScreenUtils.scaleSize(48)
    }
});
